Skip to content

fix: use ISO-8601 format for share expiration dates#169

Open
zerox80 wants to merge 2 commits into
opencloud-eu:mainfrom
zerox80:fix/expiration-date-format
Open

fix: use ISO-8601 format for share expiration dates#169
zerox80 wants to merge 2 commits into
opencloud-eu:mainfrom
zerox80:fix/expiration-date-format

Conversation

@zerox80
Copy link
Copy Markdown
Contributor

@zerox80 zerox80 commented May 20, 2026

Description

This change updates the formatting of the share expiration date (expireDate) sent by the Android app when creating or updating shares. Currently, the app formats the date as "yyyy-MM-dd".

While the public link sharing endpoint in the backend has a fallback that parses this date-only format, the endpoints for private shares (user/group shares) and space membership do not.
Specifically:

  • createUserShare (in user.go) expects _iso8601 = "2006-01-02T15:04:05Z0700".
  • updateShare (in shares.go) expects time.RFC3339 ("2006-01-02T15:04:05Z07:00").
  • addSpaceMember (in spaces.go) expects either layout.

Because "yyyy-MM-dd" doesn't match either pattern, creating or updating a private share or space membership with an expiration date always fails with an HTTP 400 Bad Request ("could not parse expireDate").

To resolve this without needing backend changes, this PR updates both CreateRemoteShareOperation and UpdateRemoteShareOperation to format the expiration timestamp as a standard UTC ISO-8601 string ("yyyy-MM-dd'T'HH:mm:ss'Z'"), which parses successfully across all backend endpoints.

Note

Currently, the app does not support setting expiration dates for private shares anyway, but this fix ensures that the API structure is already perfectly prepared and compatible for future implementations.

Changes

  • Changed FORMAT_EXPIRATION_DATE pattern to "yyyy-MM-dd'T'HH:mm:ss'Z'" in CreateRemoteShareOperation.kt and UpdateRemoteShareOperation.kt.
  • Configured SimpleDateFormat to use the UTC timezone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant